<!-- include tpl=head_lay -->
<script type="text/javascript" src="{func include_js list.js}"></script>
<form method="post" id="_listedit" class="layui-form" onsubmit="return $.admin_list_edit.save()">
<input type="hidden" name="id" id="id" value="{$id}" />
<input type="hidden" name="pid" id="pid" value="{$pid}" />
<input type="hidden" name="parent_id" id="parent_id" value="{$parent_id}" />
<div class="layui-card">
	<div class="layui-card-header">
		{lang主要信息}
		<div class="fr">
			<label id="auto_save_tip"><input type="checkbox" onclick="$.admin_list_edit.autosave_checkbox(this)" lay-ignore /> <span>{lang开启自动保存功能}</span></label>
		</div>
	</div>
	<div class="layui-card-body">
		<input type="hidden" name="style" id="style" value="{$rs.style}" />
		<div class="layui-form-item">
			<label class="layui-form-label"><!-- if $p_rs.alias_title -->{$p_rs.alias_title}<!-- else -->{lang主题}<!-- /if --></label>
			<div class="layui-input-block">
				<div class="layui-col-md9">
					<input type="text" name="title" id="title" value="{$rs.title}" class="layui-input"{if $rs.style} style="{$rs.style}"{/if} placeholder="{lang不能超过80个汉字}{if $p_rs.alias_note}，{$p_rs.alias_note}{/if}" />
				</div>
				<div class="layui-col-md2" style="margin-left:10px;margin-top:3px;">
					<button type="button" class="layui-btn layui-btn-sm" onclick="$.admin_list.style_setting('style','title')">
						<i class="layui-icon">&#xe64e;</i> {lang样式}
					</button>
				</div>
			</div>
		</div>		
		<!-- if $attrlist && $p_rs.is_attr -->
		<div class="layui-form-item">
			<label class="layui-form-label">{lang属性}</label>
			<div class="layui-input-block">
				<!-- loop from=$attrlist key=$key value=$value -->
				<input type="checkbox" name="attr[]" lay-skin="primary" id="_attr_{$key}" title="{$value.val}" value="{$key}"{if $value.status} checked{/if} />
				<!-- /loop -->
			</div>
		</div>
		<!-- /if -->
		<!-- if $p_rs.is_identifier == 2 || $p_rs.is_identifier == 3 -->
		<div class="layui-form-item">
			<label class="layui-form-label">{lang自定义标识}</label>
			<div class="layui-input-inline default-auto">
				<input type="text" id="identifier" name="identifier" value="{$rs.identifier}" class="layui-input" />
			</div>
			<div class="layui-input-inline auto" id="HTML-POINT-PHPOK-IDENTIFIER">
				<input type="button" value="{lang随机码}" onclick="$.admin.rand()" class="layui-btn layui-btn-sm" />
			</div>
			<div class="layui-form-mid">
				{lang仅支持字母、数字、下划线或中划线且必须是字母开头}
			</div>
		</div>
		<!-- /if -->
		
		<!-- if $p_rs.cate -->
		<div class="layui-form-item">
			<label class="layui-form-label">{lang主分类}</label>
			<div class="layui-input-inline default-auto">
				<select name="cate_id" id="cate_id">
					<option value="">{lang请选择…}</option>
					<!-- loop from=$catelist key=$key value=$value id=$tmpid -->
					<option value="{$value.id}"{if $value.id == $rs.cate_id} selected{/if} data-isend="{$value._is_end}" data-layer="{$value._layer}">{$value._space}{$value.title}</option>
					<!-- /loop -->
				</select>
			</div>
			<div class="layui-form-mid">{lang主分类不能为空}</div>
		</div>
		<!-- /if -->
		<!-- if $p_rs.cate && $p_rs.cate_multiple -->
		<div class="layui-form-item">
			<label class="layui-form-label">{lang扩展分类}</label>
			<div class="layui-input-block">
				<select name="ext_cate_id[]" id="ext_cate_id" class="w99" lay-ignore multiple="multiple">
				<!-- loop from=$catelist key=$key value=$value id=$tmpid -->
				<option value="{$value.id}"{if $extcate && in_array($value.id,$extcate)} selected{/if}>{$value._space}{$value.title}</option>
				<!-- /loop -->
				</select>
			</div>
			<div class="layui-input-block mtop">{lang按钮CTRL进行多选}</div>
		</div>
		<!-- /if -->
		<!-- loop from=$extlist key=$key value=$value id=$tmpid -->
		<div class="layui-form-item">
			<label class="layui-form-label">
				{$value.title}
			</label>
			<!-- if $value.note --><div class="layui-input-block gray" style="line-height:38px;">{$value.note}</div><!-- /if -->
			<div class="layui-input-block">
				{$value.html}
				<!-- if $popedom.ext && $value.is_edit && $session.adm_develop -->
				<div class="layui-btn-group">
					<!-- if $ext_module != 'add-list' -->
					<input type="button" value="{lang编辑}" class="layui-btn layui-btn-xs" onclick="ext_edit('{$value.identifier}','{$ext_module}')" />
					<!-- /if -->
					<input type="button" value="{lang删除}" class="layui-btn layui-btn-xs layui-btn-danger" onclick="ext_delete('{$value.identifier}','{$ext_module}','{$value.title}')" />
				</div>
				<!-- /if -->
			</div>
		</div>
		<!-- /loop -->
		<!-- if $p_rs.is_tag == 2 || $p_rs.is_tag == 3 -->
		<div class="layui-form-item">
			<label class="layui-form-label">{lang标签}</label>
			<div class="layui-input-block">
				<input type="text" name="tag" id="tag" value="{$rs.tag}" class="layui-input" />
			</div>
			<div class="layui-input-block mtop">
				<div class="layui-btn-group">
					<!-- if $tag_config.count && $taglist -->
					<!-- loop from=$taglist key=$key value=$value id=$tmpid -->
					<input type="button" value="{$value.title}" onclick="$.phpok_list.tag_append(this.value,'{$tag_config.separator}')" class="layui-btn layui-btn-sm" />
					<!-- /loop -->
					<!-- /if -->
					<input type="button" value="{lang更多选择}" onclick="$.phpok_list.tag()" class="layui-btn layui-btn-sm layui-btn-warm" />
					<input type="button" value="{lang清空}" onclick="$('input[name=tag]').val('')" class="layui-btn layui-btn-sm layui-btn-danger" />
				</div>
			</div>
			<div class="layui-input-block mtop">{lang多个标签用 [title] 分开，最多不能超过10个|title:$tag_config.separator}</div>
		</div>
		<!-- /if -->
		<!-- if $p_rs.is_userid == 2 || $p_rs.is_userid == 3 -->
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang会员}
			</label>
			<div class="layui-input-inline auto">
				{func form_edit user_id $rs.user_id user}
			</div>
			<div class="layui-input-inline auto gray lh38">{lang绑定会员功能，允许会员对主题进行修改或删除，需要开放发布权限}</div>
		</div>
		<!-- /if -->
		<!-- if $p_rs.is_tpl_content == 2 || $p_rs.is_tpl_content == 3 -->
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang内容模板}
			</label>
			<div class="layui-input-inline default-auto">
				<input type="text" id="tpl" name="tpl" class="layui-input" value="{$rs.tpl}" />
			</div>
			<div class="layui-input-inline auto gray">
				<div class="layui-btn-group">
					<input type="button" value="{lang选择}" onclick="phpok_tpl_open('tpl')" class="layui-btn layui-btn-sm" />
					<input type="button" value="{lang清空}" onclick="$('#tpl').val('');" class="layui-btn layui-btn-sm" />
				</div>
			</div>
			<div class="layui-input-inline auto gray lh38">
				{lang为空将使用} <span class="red">{$p_rs.tpl_content ? $p_rs.tpl_content : $p_rs.identifier.'_content'}</span>
			</div>
		</div>
		<!-- /if -->
		<!-- if $popedom.ext && $session.adm_develop -->
		<div class="layui-form-item">
			<label class="layui-form-label">{lang扩展字段}</label>
			<div class="layui-input-inline default">
				<select id="_tmp_select_add">
					<option value="">{lang请选择要添加的扩展字段…}</option>
					<!-- loop from=$extfields key=$key value=$value -->
					<option value="{$value.identifier}">{$value.title} - {$value.identifier}</option>
					<!-- /loop -->
				</select>
			</div>
			<div class="layui-input-inline auto">
				<div class="layui-btn-group">
					<input type="button" value="{lang快速添加}" onclick="$.admin_list.update_select_add('{$ext_module}')"  class="layui-btn" />
					<input type="button" value="{lang创建新的扩展字段}" onclick="ext_add('{$ext_module}')" class="layui-btn" />
				</div>
			</div>
		</div>
		<!-- /if -->
	</div>
</div>
<!-- if $p_rs.is_biz -->
<div class="layui-card">
	<div class="layui-card-header">{lang电子商务}</div>
	<div class="layui-card-body">
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang产品类型}
			</label>
			<div class="layui-input-inline auto">
				<input type="radio" title="{lang实物}" name="is_virtual" value="0"{if !$rs.is_virtual} checked{/if} />
				<input type="radio" title="{lang服务}" name="is_virtual" value="1"{if $rs.is_virtual} checked{/if} />
			</div>
			<div class="layui-input-inline auto gray lh38">{lang实物产品加入购物车后需要填写收件地址，服务不需要}</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang销售价格}
			</label>
			<div class="layui-input-inline default-auto">
				<ul class="layout">
					<li><input type="text" name="price" id="price" value="{$rs.price}" class="layui-input" /></li>
					<li>
						<select name="currency_id" id="currency_id">
							<!-- loop from=$currency_list key=$key value=$value -->
							<option value="{$value.id}"{if $rs.currency_id == $value.id} selected{/if} code="{$value.code}" rate="{$value.val}" sleft="{$value.symbol_left}" sright="{$value.symbol_right}">{$value.title}_{lang汇率} {$value.val}</option>
							<!-- /loop -->
						</select>
					</li>
				</ul>
			</div>
			<div class="layui-input-inline auto gray lh38">{lang设置产品的价格及货币类型}</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				<i class="layui-icon layui-tips" lay-tips="{lang填写产品的计量单位，以方便结算}">&#xe702;</i>
				{lang计量单位}
			</label>
			<div class="layui-input-inline">
				<input type="text" id="unit" class="layui-input" name="unit" value="{$rs.unit}" />
			</div>
			<!-- if $unitlist -->
			<div class="layui-input-inline auto">
				<div class="layui-btn-group">
					<!-- loop from=$unitlist key=$key value=$value id=$tmpid -->
					<input type="button" value="{$value}" onclick="$('#unit').val(this.value)" class="layui-btn layui-btn-sm" />
					<!-- /loop -->
				</div>
			</div>
			<!-- /if -->
		</div>
		<!-- if $freight && $freight.type == 'weight' -->
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang重量}
			</label>
			<div class="layui-input-inline auto">
				<input type="text" id="weight" class="layui-input" name="weight" value="{$rs.weight}" />
			</div>
			<div class="layui-input-inline auto gray lh38">Kg {lang可用于计算基于重量的运费，单位是千克，请注意换算}</div>
		</div>
		<!-- /if -->
		<!-- if $freight && $freight.type == 'volume' -->
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang体积}
			</label>
			<div class="layui-input-inline auto">
				<input type="text" id="volume" name="volume" class="layui-input" value="{$rs.volume}" /> 
			</div>
			<div class="layui-input-inline auto gray lh38">M<sup>3</sup> {lang设置产品体积，用于计算基于体积的运费，单位是立方米，请注意换算}</div>
		</div>
		<!-- /if -->
		<!-- if $p_rs.biz_attr -->
		<div class="layui-form-item">
			<label class="layui-form-label title" style="margin-top:3px;">
				{lang产品属性}
			</label>
			<div class="layui-input-block">{lang负号表示价格下调，加号或无符号表示价格上调，如+10或10，表示加10，-10表示减10}</div>
			<div class="layui-input-block">
				<input type="hidden" name="_biz_attr" id="_biz_attr" value="{$_attr}" />
				<div>
					<table cellpadding="0" cellspacing="0">
					<tr>
						<td>
							<select id="biz_attr_id" lay-ignore onchange="$.admin_list_edit.attr_add(this.value)">
								<option value="">{lang请选择一个属性操作内容…}</option>
								<!-- loop from=$biz_attrlist key=$key value=$value id=$tmpid -->
								<option value="{$value.id}">{$value.title}</option>
								<!-- /loop -->
							</select>
						</td>
						<td>&nbsp;</td>
						<td><input type="button" value="{lang添加新属性}" onclick="$.admin_list_edit.attr_create()" class="layui-btn layui-btn-sm" /></td>
					</tr>
					</table>
				</div>
				<ul id="biz_attr_options"></ul>
			</div>
		</div>
		<!-- /if -->
	</div>
</div>
<!-- /if -->

<!-- if $p_rs.is_seo -->
<div class="layui-card">
	<div class="layui-card-header hand" onclick="$.admin.card(this)">
		{langSEO优化}
		<i class="layui-icon{if $p_rs.is_seo == 1} layui-icon-right{else} layui-icon-down{/if}"></i>
	</div>
	<div class="layui-card-body{if $p_rs.is_seo == 1} hide{/if}">
		<div class="layui-form-item">
			<label class="layui-form-label">
				{langSEO标题}
			</label>
			<div class="layui-input-block">
				<input type="text" id="seo_title" name="seo_title" class="layui-input" value="{$rs.seo_title}" />
			</div>
			<div class="layui-input-block mtop">
				{lang设置此标题后，网站Title将会替代默认定义的，不能超过50个汉字}
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{langSEO关键字}
			</label>
			<div class="layui-input-block">
				<input type="text" id="seo_keywords" name="seo_keywords" class="layui-input" value="{$rs.seo_keywords}" />
			</div>
			<div class="layui-input-block mtop">{lang多个关键字用英文逗号隔开，为空将使用默认}</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{langSEO描述}
			</label>
			<div class="layui-input-block">
				<textarea name="seo_desc" id="seo_desc" class="layui-textarea">{$rs.seo_desc}</textarea>
			</div>
			<div class="layui-input-block mtop">{lang简单描述该主题信息，用于搜索引挈，不支持HTML，不能超过80个汉字}</div>
		</div>
	</div>
</div>
<!-- /if -->

<div class="layui-card">
	<div class="layui-card-header hand" onclick="$.admin.card(this)">
		{lang扩展信息}
		<i class="layui-icon layui-icon-right"></i>
	</div>
	<div class="layui-card-body hide">
		<!-- if $p_rs.is_identifier == 1 -->
		<div class="layui-form-item">
			<label class="layui-form-label">{lang自定义标识}</label>
			<div class="layui-input-inline default-auto">
				<input type="text" id="identifier" name="identifier" value="{$rs.identifier}" class="layui-input" />
			</div>
			<div class="layui-input-inline auto" id="HTML-POINT-PHPOK-IDENTIFIER">
				<input type="button" value="{lang随机码}" onclick="$.admin.rand()" class="layui-btn layui-btn-sm" />
			</div>
			<div class="layui-input-inline auto gray">{lang仅支持字母、数字、下划线或中划线且必须是字母开头}</div>
		</div>
		<!-- /if -->
		<!-- if $p_rs.is_userid == 1 -->
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang会员}
			</label>
			<div class="layui-input-inline auto">
				{func form_edit user_id $rs.user_id user}
			</div>
			<div class="layui-input-inline auto gray lh38">{lang绑定会员功能，允许会员对主题进行修改或删除，需要开放发布权限}</div>
		</div>
		<!-- /if -->
		<!-- if $p_rs.is_tag == 1 -->
		<div class="layui-form-item">
			<label class="layui-form-label">{lang标签}</label>
			<div class="layui-input-block">
				<input type="text" name="tag" id="tag" value="{$rs.tag}" class="layui-input" />
			</div>
			<div class="layui-input-block mtop">
				<div class="layui-btn-group">
					<!-- if $tag_config.count && $taglist -->
					<!-- loop from=$taglist key=$key value=$value id=$tmpid -->
					<input type="button" value="{$value.title}" onclick="$.phpok_list.tag_append(this.value,'{$tag_config.separator}')" class="layui-btn layui-btn-sm" />
					<!-- /loop -->
					<!-- /if -->
					<input type="button" value="{lang更多选择}" onclick="$.phpok_list.tag()" class="layui-btn layui-btn-sm layui-btn-warm" />
					<input type="button" value="{lang清空}" onclick="$('input[name=tag]').val('')" class="layui-btn layui-btn-sm layui-btn-danger" />
				</div>
			</div>
			<div class="layui-input-block mtop">{lang多个标签用 [title] 分开，最多不能超过10个|title:$tag_config.separator}</div>
		</div>
		<!-- /if -->
		<!-- if $p_rs.is_tpl_content == 1 -->
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang内容模板}
			</label>
			<div class="layui-input-inline default-auto">
				<input type="text" id="tpl" name="tpl" class="layui-input" value="{$rs.tpl}" />
			</div>
			<div class="layui-input-inline auto gray">
				<div class="layui-btn-group">
					<input type="button" value="{lang选择}" onclick="phpok_tpl_open('tpl')" class="layui-btn layui-btn-sm" />
					<input type="button" value="{lang清空}" onclick="$('#tpl').val('');" class="layui-btn layui-btn-sm" />
				</div>
			</div>
			<div class="layui-input-inline auto gray lh38">
				{lang为空将使用} <span class="red">{$p_rs.tpl_content ? $p_rs.tpl_content : $p_rs.identifier.'_content'}</span>
			</div>
		</div>
		<!-- /if -->
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang状态}
			</label>
			<div class="layui-input-inline auto">
				<input type="radio" title="{lang未审核}" name="status" id="status_0" value="0"{if $id && !$rs[status]} checked{/if} />
				<input type="radio" name="status" title="{lang已审核}" id="status_1" value="1"{if !$id || $rs[status]} checked{/if} />
			</div>
			<div class="layui-input-inline auto gray lh38">{lang未审核主题前台不可用，不可访问}</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang是否隐藏}
			</label>
			<div class="layui-input-inline auto">
				<input type="radio" title="{lang显示}" name="hidden" id="hidden_0" value="0"{if !$rs[hidden]} checked{/if} />
				<input type="radio" title="{lang隐藏}" name="hidden" id="hidden_1" value="1"{if $rs.hidden} checked{/if} />
			</div>
			<div class="layui-input-inline auto gray lh38">{lang隐藏的主题在列表中不可见，但可以手工输网址访问}</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang发布时间}
			</label>
			<div class="layui-input-inline auto">
				<input type="text" id="dateline" name="dateline" class="layui-input" value="{if $rs.dateline}{func date 'Y-m-d H:i:s' $rs.dateline}{/if}" />
			</div>
			<div class="layui-input-inline auto">
				<div class="layui-btn-group">
					<input type="button" value="{lang时间选择器}" onclick="$.phpokform.laydate_button('dateline','datetime')" class="layui-btn layui-btn-sm" id="btn_dateline_datetime" />
					<input type="button" value="{lang清空}" onclick="$.phpokform.clear('dateline')" class="layui-btn layui-btn-sm" />
				</div>
			</div>
			<div class="layui-input-inline auto gray lh30">{lang自定义发布时间，留空使用系统时间}</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang阅读次数}
			</label>
			<div class="layui-input-inline auto">
				<input type="text" id="hits" name="hits" class="layui-input" value="{$rs.hits}" />
			</div>
			<div class="layui-input-inline auto gray lh30">{lang正常情况请不要设置，以保证数据的准确，仅支持整数}</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang财富基数}
			</label>
			<div class="layui-input-inline auto">
				<input type="text" id="integral" class="layui-input" name="integral" value="{$rs.integral}" />
			</div>
			<div class="layui-input-inline auto gray lh38">{lang只支持整数，用于计算会员虚拟财富增减}</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">
				{lang排序}
			</label>
			<div class="layui-input-inline auto">
				<input type="text" id="sort" name="sort" class="layui-input" value="{$rs.sort}" />
			</div>
			<div class="layui-input-inline auto gray lh38">{lang排序值只支持数字，不清楚请留空}</div>
		</div>
	</div>
</div>
<div class="submit-info">
	<div class="layui-container center">
		<input type="submit" value="{lang保存}" class="layui-btn layui-btn-lg layui-btn-danger" />
		<!-- if $id && $p_rs.is_front -->
		<input type="button" value="{lang预览}" title="需要先点击保存" class="layui-btn layui-btn-lg layui-btn-warm" onclick="$.phpok.open('{$sys.www_file}?id={$id}')" />
		<!-- /if -->
		<input type="button" value="{lang取消并关闭}" class="layui-btn layui-btn-lg layui-btn-primary" onclick="$.admin.close()" />
		<!-- if $id -->
		<span class="gray i">编辑操作不会关闭窗口，请手动关闭<!-- if $p_rs.is_front -->，预览前需要先保存数据<!-- /if --></span>
		<!-- /if -->
	</div>
</div>
<div class="submit-info-clear"></div>
</form>
<!-- include tpl=foot_lay -->